package web.dynamic.client.widgets;

import java.util.ArrayList;
import java.util.List;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;

public class DGrid extends Grid<ModelData> implements Configurable {
	

	@Override
	public void configure(Context config, Context context) {
	}
	
		public DGrid(Context config, Context context) {

		// get store ref
		DListStore store;
		//store = context.<DListStore>getInstance( config.<String>get("storeId") );
		/*
		if( config.hasItem('bound')  ) 
			
		else
			store = 
		
		// create columns
		List< Context > colConfigs = config.get("columns");
		List< ColumnConfig > cols = new ArrayList<ColumnConfig>();
		for (Context colConfig : colConfigs) {
			ColumnConfig cc = new ColumnConfig();
			cc.setDataIndex( colConfig.<String>get("DataIndex")  );
//			...
			cols.add(cc);
		}
		
		super(store, new ColumnModel(cols) );
		*/
		
		// add buttons
		
	}

}
